import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    component: () => import('../pages/login.vue')
  },
  {
    path: '/index',
    component: () => import('../pages/home.vue'),
    children: [
      {
        path: '/setshop',
        component: () => import('../views/setshop/setshop.vue')
      },
      {
        path: '/setpeople',
        component: () => import('../views/setpeople/setpeople.vue')
      },
    ]
  },
  {
    path: '/',
    redirect: "/login"
  }

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
